package org.example.controller;

import jakarta.annotation.Resource;
import org.example.pojo.Task;
import org.example.service.TasksAnalyzeService;
import org.example.utils.R;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("TaskAnalyze")
public class TasksAnalyze {
    @Resource
    private TasksAnalyzeService service;
    @GetMapping("getTaskTodayList")
    public R getTaskTodayList(){
        List<Task>taskTodayList = service.getTaskTodayList();
        return R.successful(null,taskTodayList);
    }
    @GetMapping("getTaskCategory")
    public R getTaskCategory(){
        List<Integer> categroy = service.getTaskCategory();
        return R.successful(null,categroy);
    }
    @GetMapping("getTaskRating")
    public R getTaskRating(){
        List<Integer> taskRating = service.getTaskRating();
        return R.successful(null,taskRating);
    }

}
